{extend name="template/base" /}
{block name="content"}
<div class="page-container">
<script>
	function preview(id){
			var url=$('#'+id).val();
			if(url==null||url=="")
				url="/admin/Emptynull/index.html";
			layer_open('图片预览',url);
		}
</script>
<script type="text/javascript" src="__STATIC__/js/My97DatePicker/WdatePicker.js"></script>
    <form class="form form-horizontal" id="form" method="post" action="{:\\think\\Request::instance()->baseUrl()}">
        <input type="hidden" name="id" value="{$vo.id ?? ''}">
		<div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>相片：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" value="{$vo.avator ?? ''}"
                    id="avator"  placeholder="" name="avator" datatype="*" nullmsg="请点击右侧上传图片">
            </div>
			<button type="button"  class="btn btn-primary radius" onclick="layer_open('文件上传','{:url('Upload/index',array('id'=>'avator'))}')">上传图片</button>
            <button onclick="preview('avator')" type="button" class="btn btn-success radius" data-lightbox="preview">预览</button>
			<span class="c_999"></span>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
		<div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>序列号：</label>
            <div class="formControls col-xs-6 col-sm-6">
              <input type="text" class="input-text" value="{$vo.serial ?? $serial}" id="serial" readonly="readonly" name="serial" datatype="*" nullmsg="请填写序列号">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
		<div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>姓名：</label>
            <div class="formControls col-xs-6 col-sm-6">
              <input type="text" class="input-text" value="{$vo.name ?? ''}" id="name"  placeholder="姓名" name="name" datatype="*" nullmsg="请填写姓名">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
		<div class="row cl" style="display:none;">
            <label class="form-label col-xs-3 col-sm-3">民族：</label>
            <div class="formControls col-xs-6 col-sm-6">
              <input type="text" class="input-text" value="{$vo.minzu ?? ''}" id="minzu"  placeholder="民族" name="minzu">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
		<div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>申请车型：</label>
            <div class="formControls col-xs-6 col-sm-6 skin-minimal">
				{volist name="card_type" id="vo2"}
					<div class="radio-box">
						<label for="radio-{$vo2.id}">{$vo2.name}</label>
						{if condition="isset($vo.car_type)"}
							{if condition="$vo2.id eq $vo.car_type"}
								<input type="radio" checked="checked" name="car_type" id="radio-{$vo2.id}" value="{$vo2.id}">
							{else /}
								<input type="radio" name="car_type" id="radio-{$vo2.id}" value="{$vo2.id}">
						{/if}
						{elseif condition="$vo2.isdefault eq 1"}
							<input type="radio" checked="checked" name="car_type" id="radio-{$vo2.id}" value="{$vo2.id}">
						{else /}
							<input type="radio" name="car_type" id="radio-{$vo2.id}" value="{$vo2.id}">
						{/if}
					</div>
				{/volist}
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
	<!-- 	<div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>性别：</label>
            <div class="formControls col-xs-6 col-sm-6 skin-minimal">
                <div class="radio-box">
                    <input type="radio" name="sex" id="radio-0" value="男">
                    <label for="radio-0">男</label>
                </div>
                <div class="radio-box">
                    <input type="radio" name="sex" id="radio-1" value="女">
                    <label for="radio-1">女</label>
                </div>
				<div class="radio-box">
                    <input type="radio" name="sex" id="radio-2" value="未知">
                    <label for="radio-2">未知</label>
                </div>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div> -->
		<div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>身份证号：</label>
            <div class="formControls col-xs-6 col-sm-6">
              <input type="text" class="input-text" value="{$vo.card_num ?? ''}" id="card_num"  placeholder="身份证号码" name="card_num" datatype="*" nullmsg="请填写身份证号">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>驾校：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <select name="school" class="input-text">
                {volist name="school" id="vv"}
                <option value="{$vv.name}" {eq name="vv['name']" value="$vo['school']"} selected="selected" {/eq}>{$vv.name}</option>
               {/volist}
             </select>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
		<div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>培训时间：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" onClick="WdatePicker()" class="input-text" placeholder="培训时间" name="edu_date" value="{$vo.edu_date ?? ''}" datatype="*" nullmsg="请填写培训时间">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
	<!-- 	<div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>家庭住址：</label>
            <div class="formControls col-xs-6 col-sm-6">
              <input type="text" class="input-text" value="{$vo.address ?? ''}" id="address"  placeholder="" name="address" datatype="*" nullmsg="请填写家庭住址">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
		<div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>联系方式：</label>
            <div class="formControls col-xs-6 col-sm-6">
              <input type="text" class="input-text" value="{$vo.mobile ?? ''}" id="mobile"  placeholder="" name="mobile" datatype="*" nullmsg="请填写联系方式">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div> -->
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
                <button type="button" class="btn btn-default radius ml-20" onClick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<script>
    $(function () {
		$("[name='sex'][value='{$vo.sex ?? '男'}']").attr("checked", true);
        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        $("#form").Validform({
            tiptype: 2,
            ajaxPost: true,
            showAllError: true,
            callback: function (ret){
                ajax_progress(ret);
            }
        });
    })
</script>
{/block}
